﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <title>签到</title>
    <link rel="stylesheet" type="text/css" href="css/style.css?v=1" />
</head>
<body>
    <div class="contmobile">
        <div class="page page1">
            <div class="qd-logo" style="font-size: 1.8em">常州大学</div>
            <div class="qd-logo">教室：<span id="js"></span></div>


            <div class="btn-qd" style="display:none">
                <p id="time"></p>
                <img src="images/qrcode.jpg" style="width: 100%; height: 100%; display: none" />
                <p class="ewmqd" style="line-height: 2rem; position: absolute; top: 11rem; width: 12rem; margin-left: -1rem; display: none">请先关注再签到<br/>长按识别二维码关注</p>
               
            </div>
            <div class="qd-msg">
                <img src="images/head.png" class="tx-qd">
                <div class="msg-qd">
                    <a style="text-align: left">姓名:<span id="xm"></span>
                        <br />
                        学号：<span id="xh"></span> </a>
                </div>
            </div>
          
        </div>
    </div>

    <script type="text/javascript" src="/prototype/phone/js/query-1.11.1.min.js"></script>
    <script type="text/javascript">

        function getQueryString(name, defauval) {//获取URL参数,如果获取不到，返回默认值，如果没有默认值，返回空格
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) { return unescape(decodeURI(r[2])); }
            else {
                return defauval || "";
            }
        }
        var ticket = getQueryString("ticket", "");
        var test = new Date();

        $.getJSON('/API/VIEWAPI.ashx?Action=Commanage_GETJS', { P1: ticket }, function (resultData) {
            if (resultData.ErrorMsg == "") {
                $("#js").text(resultData.Result1);
                var user = $.parseJSON(resultData.Result)
                if (typeof (user.avatar) != "undefined") {
                    $("#xm").text(user.name);
                    $("#xh").text(user.userid);
                    $(".qd-msg").addClass("animated fadeInUpBig").show();
                    $(".tx-qd").attr("src", user.avatar);

                    Date.prototype.Format;
                    h = test.getHours();
                    m = test.getMinutes();
                    $(".btn-qd").show().click(function () {
                        $(this).addClass("btn-yqd animated pulse");
                        $("#time").html(h + ":" + m);
                        $.get('/API/VIEWAPI.ashx?Action=Commanage_GETYYY', { P1: ticket }, function (resultData) {
                           
                        })
                    })
                }
                else {
                    $(".btn-qd").show();
                    $(".btn-qd").find("img").show();
                    $(".btn-qd").find(".ewmqd").show();

                }

            }
        })
   
    </script>

</body>
</html>
